<template>
    <div>
     <table>
      <tr>
        <td>房间名称</td>
        <td><input type="text" v-model="state.mname"></td>
    </tr>
      <tr>
        <td>名称</td>
        <td><input type="text" v-model="state.mnumName"></td>
    </tr>
      <tr>
        <td>数量</td>
        <td><input type="text" v-model="state.mnum"></td>
    </tr>
      <tr>
        <td>日期</td>
        <td><input type="date" v-model="state.mdateTime"></td>
    </tr>
      <tr>
        <td>简介</td>
        <td><input type="text" v-model="state.mjianjie"></td>
    </tr>
        <tr>
        <td></td>
        <td><input type="button" value="添加" @click="addMember"/></td></tr>
     </table>
    </div>
</template>

<script setup lang="ts">
import { reactive, onMounted,toRefs} from 'vue'   
import { useRoute, useRouter} from 'vue-router'
import axios from 'axios'
const router = useRouter()
const route = useRoute()

const data = reactive({
    state:{
        mname:''，
        mnumName''，
        mnum:''，
        mdateTime:''，
        mjianjie:''，
        
    }
})

const {state} = toRefs(data)

const addMember = () => {
    axios({
        url:'https://localhost:7265/api/Member/addmember',
        method:'post',
        data:state.value
    }).then((res) => {
        if(res.data.data>0){
            alert('添加成功')
          
        }else{
            alert('失败')
        }
    })
}




</script>

<style scoped>

</style>